//
//  LSApplyExpertCollectionCell.m
//  LookScore
//
//  Created by warrior on 2018/5/29.
//  Copyright © 2018年 ChongQingXunTiCompany. All rights reserved.
//

#import "LSApplyExpertCollectionCell.h"
#import <UIButton+WebCache.h>

@interface LSApplyExpertCollectionCell()

@end

@implementation LSApplyExpertCollectionCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self initializeInterface];
    }
    return self;
}
- (void)initializeInterface{
    
    [self.contentView addSubview:self.expertHeadImg];
    [self.contentView addSubview:self.expertNameLab];
    
    self.expertHeadImg.sd_layout
    .centerXEqualToView(self.contentView)
    .topEqualToView(self.contentView).offset(LSAutoVlaue(10, LSScreenHeight))
    .widthIs(LSAutoVlaue(50, LSScreenWidth))
    .heightIs(LSAutoVlaue(50, LSScreenHeight));
    self.expertHeadImg.layer.masksToBounds = YES;
    self.expertHeadImg.layer.cornerRadius = LSAutoVlaue(25, LSScreenWidth);
    
    self.expertNameLab.sd_layout
    .leftEqualToView(self.contentView)
    .rightEqualToView(self.contentView)
    .topSpaceToView(self.expertHeadImg, LSAutoVlaue(5, LSScreenWidth))
    .autoHeightRatio(0);
    
}
- (void)layoutSubviews{
    [super layoutSubviews];
    
}

- (void)setModel:(LSRecommendListModel *)model{
    _model = model;
    [self.expertHeadImg sd_setImageWithURL:[NSURL URLWithString:model.UserHeadUrl] placeholderImage:[UIImage imageNamed:@"MineDefaultHead"] options:SDWebImageRefreshCached];
    self.expertNameLab.text =  model.UserDisName;

}
#pragma mark -- Getter
- (UIImageView *)expertHeadImg{
    if (!_expertHeadImg) {
        _expertHeadImg = [[UIImageView alloc] init];
        
    }
    return _expertHeadImg;
}

- (UILabel *)expertNameLab{
    if (!_expertNameLab) {
        _expertNameLab = [[UILabel alloc] init];
        //        _ExpertName.backgroundColor = [UIColor redColor];
        //        _ExpertName.text = @"足彩分析师";
        _expertNameLab.textAlignment = NSTextAlignmentCenter;
        _expertNameLab.font = LSFontSize(15,LSScreenWidth);
        _expertNameLab.textColor = LSSubColor5D5D5D;
    }
    return _expertNameLab;
}
@end
